﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AlarmClock.UI.Controls
{
    public partial class DatePick_Ctrl : UserControl
    {
        public DatePick_Ctrl()
        {
            InitializeComponent();
        }

        private DateTime timeStart =>
            DateTime.Parse($"{Date_Start.Text} {Hour_Start.Text}:{Minute_Start.Text}:{Second_Start.Text}");
        private DateTime timeEnd =>
            DateTime.Parse($"{Date_End.Text} {Hour_End.Text}:{Minute_End.Text}:{Second_End.Text}");

        /// <summary>
        /// 星期差数
        /// </summary>
        public double weeks => days / 7;
        /// <summary>
        /// 天数差数
        /// </summary>
        public double days => (timeEnd - timeStart).TotalDays;
        /// <summary>
        /// 小时差数
        /// </summary>
        public double hours => (timeEnd - timeStart).TotalHours;
        /// <summary>
        /// 分差数
        /// </summary>
        public double minutes => (timeEnd - timeStart).TotalMinutes;
        /// <summary>
        /// 秒差数
        /// </summary>
        public double seconds => (timeEnd - timeStart).TotalSeconds;
        /// <summary>
        /// 毫秒差数
        /// </summary>
        public double milliSeconds => (timeEnd - timeStart).TotalMilliseconds;
    }
}
